﻿using System;
using Microsoft.Synchronization.Files;

namespace Microsoft.WindowsAzure.Accelerator.Synchronization
{
    /// <summary>
    /// Contains the event data for blobs.
    /// </summary>
    internal class CloudSyncEventArgs : EventArgs
    {
        private readonly ChangeType _changeType;
        private readonly String _currentBlobName;
        private readonly String _newBlobName;
        
        /// <summary>
        /// Initializes a new instance of the <see cref="CloudSyncEventArgs"/> class.
        /// </summary>
        /// <param name="changeType">Type of the change.</param>
        /// <param name="currentBlobName">Name of the current BLOB.</param>
        public CloudSyncEventArgs(ChangeType changeType, String currentBlobName) : this(changeType, currentBlobName, String.Empty)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="CloudSyncEventArgs"/> class.
        /// </summary>
        /// <param name="changeType">Type of the change.</param>
        /// <param name="currentBlobName">Name of the current BLOB.</param>
        /// <param name="newBlobName">New name of the BLOB.</param>
        public CloudSyncEventArgs(ChangeType changeType, String currentBlobName, String newBlobName)
        {
            _changeType = changeType;
            _currentBlobName = currentBlobName;
            _newBlobName = newBlobName;
        }

        /// <summary>
        /// Gets the type of the change.
        /// </summary>
        /// <value>The type of the change.</value>
        public ChangeType ChangeType
        {
            get { return _changeType; }
        }

        /// <summary>
        /// Gets the name of the current BLOB.
        /// </summary>
        /// <value>The name of the current BLOB.</value>
        public String CurrentBlobName
        {
            get { return _currentBlobName; }
        }

        /// <summary>
        /// Gets the new name of the BLOB.
        /// </summary>
        /// <value>The new name of the BLOB.</value>
        public String NewBlobName
        {
            get { return _newBlobName; }
        }
    }
}